import axios from 'axios'

// create an axios instance
const service = axios.create({
  baseURL: process.env.QINIU_API,
  timeout: 5000, // request timeout
})

// request interceptor
service.interceptors.request.use(config => {
  // Do something before request is sent

  return config
}, error => {
  // Do something with request error
  console.log(error) // for debug
  Promise.reject(error)
})

export default service
